package com.xiashitech.agent.instrumentation.redis.lettuce;

import com.xiashitech.agent.instrumentation.async.boot.AsyncCallback;
import com.xiashitech.agent.instrumentation.redis.RedisData;
import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter;

/**
 * Lettuce异步响应的回调处理
 * @author zhaoyk
 */
public class XSLettuceAsyncCallback extends AsyncCallback<RedisData, Object> {

    public XSLettuceAsyncCallback(Instrumenter<RedisData, Object> instrumenter, RedisData redisData) {
        super(instrumenter, redisData);
    }

    @Override
    protected Object buildResponse(RedisData redisData, Object rtn) {
        if(rtn instanceof byte[]) {
            return rtn;
        }
        return null;
    }

}
